<template>
  <div style="height:100%;width:100%;position:relative;">
      <div class="pagetop">
          <div style="width:100%">
              <div style="width:100%;float:left">
                  <table style="font-size:12px" class="table1style">
                      <tr>
                          <td>快速查询</td>
                          <td>
                              <el-input v-model="txtsearch" clearable placeholder="类别说明|类别代号|拼音码" @keyup.enter.native="InitPage"></el-input>
                          </td>
                          <td>所属系统</td>
                          <td>
                              <el-select v-model="txtsystem" clearable filterable @change="InitPage">
                                  <el-option v-for="(item,index) in systemOptions" :key="index" :value="item.value" :label="item.label" filter></el-option>
                              </el-select>
                          </td>
                          <td>安全性</td>
                          <td>
                              <el-select v-model="txtsecurity" clearable filterable @change="InitPage">
                                  <el-option v-for="item in securityOptions" :key="item.value" :value="item.value" :label="item.label" filter></el-option>
                              </el-select>
                          </td>
                      </tr>
                  </table>
              </div>
              <div style="width:100%;float:left;">
                  <table style="float:right">
                      <tr>
                          <td>
                              <el-button icon="el-icon-search" type="primary" @click="InitPage()" v-has="'PINQUERY'">查询</el-button>
                          </td>
                          <!-- <td>
                              <el-button icon="el-icon-plus" @click="btnAdd()" :disabled="true">新增</el-button>
                          </td>
                          <td>
                              <el-button icon="el-icon-delete" @click="btnDelete()" :disabled="true">删除</el-button>
                          </td> -->
                          <td>
                              <el-button icon="el-icon-document" @click="btnSave()" :disabled="!changeflag">保存</el-button>
                          </td>
                          <td>
                              <el-button icon="el-icon-close" @click="btnCancel()" :disabled="!changeflag">取消</el-button>
                          </td>
                          <td>
                              <el-button icon="el-icon-printer" @click="btnPrint($event)">打印</el-button>
                          </td>
                          <!-- <td>
                              <el-button icon="el-icon-files" @click="btnExport()">导出</el-button>
                          </td>
                          <td>
                              <el-button icon="el-icon-files" @click="btnImport()">导入</el-button>
                          </td> -->
                          <td>
                              <el-button @click="btnAddDetail()">新增明细</el-button>
                          </td>
                          <td>
                              <el-button @click="btnInsertDetail()">插入明细</el-button>
                          </td>
                          <td>
                              <el-button @click="btnDelDetail()">删除明细</el-button>
                          </td>
                      </tr>
                  </table>
              </div>
          </div>
      </div>
      <div class="pagecenter">
          <div class="middle-center">
              <vxe-table :data.sync="tableData" :loading="loading" :select-config="{reserve: true}" :edit-config="{showIcon:false}" :sort-config="{trigger: 'cell'}" border height="auto" highlight-current-row highlight-hover-column highlight-hover-row how-header-overflow ref="xTable" resizable show-overflow size="mini" stripe @current-change="currentChangeEvent" :row-class-name="xTableRowClassName">
                  <vxe-table-column field="sysno" title="所属系统" width="90" header-align="center" :edit-render="{name:'select', options: systemOptions}"></vxe-table-column>
                  <vxe-table-column field="kindna" title="类别说明" width="198" header-align="center"></vxe-table-column>
                  <vxe-table-column field="kindno" title="类别代号" width="147" header-align="center"></vxe-table-column>
                  <vxe-table-column field="securityflag" title="安全性" width="87" header-align="center" :edit-render="{name:'select', options: securityOptions}" align="center"></vxe-table-column>
                  <vxe-table-column field="kindlen" title="长度" width="87" header-align="center" align="center"></vxe-table-column>
              </vxe-table>
          </div>
          <div class="middle-right">
              <rm-layout-top splitcolor="#FFFFFF" :splitwidth=5 :fixsize=170>
                  <template v-slot:fix>
                      <div style="height:170px;border:1px solid #CCC">
                          <el-form ref="form" :model="seckind" label-width="80px">
                              <table class="table1style" style="font-size:12px;width:100%">
                                  <tr>
                                      <td align="right">
                                          <font color="#F56C6C">类别代号</font>
                                      </td>
                                      <td>
                                          <el-input v-model="seckind.kindno" :readonly="disabled" ref="refkindno" @keyup.enter.native="inputautofocus('refkindno')" @change="kindnoChange"></el-input>
                                      </td>
                                      <td align="right">助&nbsp;&nbsp;记&nbsp;&nbsp;符</td>
                                      <td>
                                          <el-input v-model="seckind.inputcode" ref="refinputcode" @input="hasChange" @keyup.enter.native="inputautofocus('refinputcode')"></el-input>
                                      </td>
                                  </tr>
                                  <tr>
                                      <td align="right">
                                          <font color="#F56C6C">类别说明</font>
                                      </td>
                                      <td>
                                          <el-input v-model="seckind.kindna" @change.native="createInputcode" @input="hasChange" ref="refkindna" @keyup.enter.native="inputautofocus('refkindna')"></el-input>
                                      </td>
                                      <td align="right">
                                          <font color="#F56C6C">字段长度</font>
                                      </td>
                                      <td>
                                          <el-input v-model="seckind.kindlen" placeholder="" type="number" @change="hasChange" ref="refkindlen" @keyup.enter.native="inputautofocus('refkindlen')"></el-input>
                                      </td>
                                  </tr>
                                  <tr>
                                      <td align="right">所属系统</td>
                                      <td>
                                          <el-select v-model="seckind.sysno" @change="hasChange" @keyup.enter.native="inputautofocus('refsysno')" ref="refsysno" filterable clearable style="width:100%">
                                              <el-option v-for="(item,index) in systemOptions" :key="index" :value="item.value" :label="item.label" filter></el-option>
                                          </el-select>
                                      </td>
                                      <td align="right">安&nbsp;&nbsp;全&nbsp;&nbsp;性</td>
                                      <td>
                                          <el-select v-model="seckind.securityflag" @change="hasChange" ref="refsecurityflag" @keyup.enter.native="inputautofocus('refsecurityflag')" filterable clearable style="width:100%">
                                              <el-option v-for="(item,index) in securityOptions" :value="item.value" :label="item.label" :key="index">{{item.label}}</el-option>
                                          </el-select>
                                      </td>
                                  </tr>
                                  <tr>
                                      <td align="right">强制排序</td>
                                      <td>
                                          <el-select v-model="seckind.sortbycode" @change="SortByChange($event)" ref="refsortbycode" @keyup.enter.native="inputautofocus('refsortbycode')" filterable clearable style="width:100%">
                                              <el-option v-for="(item,index) in sortbyOptions" :value="item.value" :label="item.label" :key="index">{{item.label}}</el-option>
                                          </el-select>
                                      </td>
                                  </tr>
                                  <tr>
                                      <td align="right">说&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;明</td>
                                      <td colspan="3">
                                          <el-input v-model="seckind.description" ref="refdescription" type="textarea" rows="2" @input="hasChange" @keyup.enter.native="inputautofocus('refdescription')"></el-input>
                                      </td>
                                  </tr>
                              </table>
                          </el-form>
                      </div>
                  </template>
                  <div style="height:100%;width:100%;background-color:#FFFFFF;">
                      <vxe-table :data.sync="tableData1" :loading="loading1" :select-config="{reserve: true}" :sort-config="{trigger: 'cell'}" border height="auto" :edit-config="{trigger: 'click', mode: 'cell',activeMethod:activeCell, showStatus: true,showIcon:false}" :keyboard-config="keyConfig" @edit-closed="EditClose" highlight-current-row highlight-hover-column highlight-hover-row how-header-overflow ref="xTable1" resizable show-overflow size="mini" stripe @edit-actived="EditActived">
                          <vxe-table-column field="kindno" title="类别" width="96" header-align="center"></vxe-table-column>
                          <vxe-table-column field="codeno" title="代号" width="76" header-align="center" :edit-render="{name:'input', autoselect: true,events: {change: hasChange}}"></vxe-table-column>
                          <vxe-table-column field="codena" title="代号说明" width="88" header-align="center" :edit-render="{name:'input', autoselect: true,events: {change: hasChange}}"></vxe-table-column>
                          <vxe-table-column field="inputcode" title="助记符" width="87" header-align="center" :edit-render="{name:'input', autoselect: true,events: {change: hasChange}}"></vxe-table-column>
                          <vxe-table-column field="securityflag" title="安全性 " width="70" header-align="center" :edit-render="{name:'select', options: securityOptions,events: {click: hasChangeSecurity}}"></vxe-table-column>
                          <vxe-table-column field="seq" title="序号 " width="57" header-align="center" :edit-render="{name:'input', autoselect: true,events: {change: hasChange}}"></vxe-table-column>
                      </vxe-table>
                  </div>
              </rm-layout-top>
          </div>
      </div>
  </div>
</template>

<script type="text/javascript">
import XEUtils from "xe-utils";
export default {
  name: "MNG220",
  data() {
      return {
          systemOptions: [],
          securityOptions: [
              { label: "", value: "" },
              { label: "系统", value: "S" },
              { label: "用户", value: "U" },
          ],
          sortbyOptions: [
              { label: "", value: "" },
              { label: "按照代码排序", value: "1" },
              { label: "按照序号排序", value: "2" },
              { label: "按照名称排序", value: "0" },
          ],
          tableData: [],
          loading: false,
          tableData1: [],
          loading1: false,
          disabled: true,
          operate: "M",
          txtsecurity: "",
          txtsystem: "",
          txtsearch: "",
          seckind: {
              kindno: "",
              kindna: "",
              kindlen: "",
              inputcode: "",
              securityflag: "",
              description: "",
              sysno: "",
              sortbycode: "",
          },
          selrow: [],
          changeflag: false,
          oldFormData: {},
          statusflag: "NHC", //未改变
          keyConfig: {
              isDel: true,
              isTab: true,
              isEdit: true,
              isArrow: true,
          },
          utype: this.$tool.getSession(this.$tool.loginutype),
          userno: this.$tool.getSession(this.$tool.loginusername),
      };
  },
  created() {
      this.InitOption(); //初始化下拉框的数据
      this.InitPage(); //初始化主列表
  },
  computed: {
      // list() {
      //     let filterName = this.txtsearch.trim();
      //     if (filterName) {
      //         let rest = this.tableData.filter((item) => {
      //             return item.kindno.toUpperCase().indexOf(filterName.toUpperCase()) > -1 || (item.inputcode ? item.inputcode.toUpperCase().indexOf(filterName.toUpperCase()) > -1 : false) || (item.kindna ? item.kindna.indexOf(filterName) > -1 : false);
      //         });
      //         return rest;
      //     } else {
      //         return this.tableData;
      //     }
      // },
  },
  watch: {
      // txtsearch(val) {
      //     this.$nextTick(() => {
      //         var row = this.$refs.xTable.getCurrentRow();
      //         if (!!row) {
      //             if (this.$refs.xTable.tableData.length > 0) row = this.$refs.xTable.tableData[0];
      //             if (row.kindno) {
      //                 this.$refs.xTable.setCurrentRow(row);
      //                 this.queryDetail(row.kindno);
      //             }
      //         } else {
      //             this.seckind = {};
      //             this.tableData1 = [];
      //         }
      //     });
      // },
  },
  mounted() {},
  updated() {},
  methods: {
      InitOption() {
          this.$tool
              .request({
                  url: "MNG/MNG2/MNG220",
                  method: "post",
                  data: {
                      action: "InitOption",
                  },
              })
              .then((res) => {
                  this.systemOptions = res;
              })
              .catch((e) => {});
      },
      InitPage() {
          this.loading = true;
          this.$tool
              .request({
                  url: "MNG/MNG2/MNG220",
                  method: "post",
                  data: {
                      action: "InitPage",
                      security: this.txtsecurity,
                      system: this.txtsystem,
                      txtsearch: this.txtsearch,
                  },
              })
              .then((res) => {
                  this.tableData = res.Data;
                  this.statusflag = "NHC";
                  if (res.Data.length > 0) {
                      this.$refs.xTable.setCurrentRow(res.Data[0]); //高亮行
                      this.selrow = res.Data[0];
                      this.queryDetail(res.Data[0].kindno); //高亮行
                  } else {
                      this.$refs.xTable.setCurrentRow(null);
                      this.tableData = [];
                      this.tableData1 = [];
                      this.seckind = {};
                      this.selrow = [];
                  }
                  this.operate = "M";
                  this.loading = false;
              })
              .catch((e) => {
                  this.loading = false;
              });
      },
      queryDetail(kindno) {
          this.loading1 = true;
          this.$tool
              .request({
                  url: "MNG/MNG2/MNG220",
                  method: "post",
                  data: {
                      action: "queryDetail",
                      kindno: kindno,
                      sortby: this.seckind.sortbycode,
                  },
              })
              .then((res) => {
                  this.tableData1 = res.Data1;
                  if (res.Data1.length > 0) {
                      this.$refs.xTable1.setCurrentRow(res.Data1[0]);
                  } else {
                      this.$refs.xTable1.setCurrentRow(null);
                  }
                  let row = res.Data2[0];
                  this.seckind = {
                      kindno: row.kindno,
                      kindna: row.kindna,
                      kindlen: row.kindlen,
                      inputcode: row.inputcode,
                      securityflag: row.securityflag,
                      description: row.description,
                      sysno: row.sysno,
                      sortbycode: row.sortbycode,
                  };
                  this.oldFormData = XEUtils.clone(this.seckind, true);
                  let xTable1date = this.$refs.xTable1.tableData;
                  for (let i = 0, len = xTable1date.length; i < len; i++) {
                      let tempseq = (i + 1) * 10;
                      if (tempseq !== xTable1date[i].seq) {
                          xTable1date[i].seq = tempseq;
                      }
                  }
                  this.loading1 = false;
              })
              .catch((e) => {
                  this.loading1 = false;
              });
      },
      createInputcode() {
          let _this = this;
          this.seckind.inputcode = this.$pub.CreateInputcode(this.seckind.kindna, _this, 16);
      },
      currentChangeEvent({ row, column }) {
          if (this.statusflag == "HC") {
              // 点击切换之前的 row
              this.$refs.xTable.setCurrentRow(this.selrow);
              return false;
          }
          this.selrow = row;
          this.queryDetail(row.kindno);
      },
      btnAdd() {
          this.operate = "A";
          this.statusflag = "HC";
          this.disabled = false; //类别代号可编辑
          this.changeflag = true; //标识改变
          this.$refs.refkindno.focus();
          this.seckind = {
              kindno: "",
              kindna: "",
              kindlen: "10",
              inputcode: "",
              securityflag: "U",
              description: "",
              sysno: "",
              sortbycode: "",
          };

          this.tableData1 = [];
      },
      async btnDelete() {
          this.operate = "D";
          let row = this.$refs.xTable.getCurrentRow();
          let alld = this.$refs.xTable.tableData;
          let rowindex = alld.indexOf(row);
          await this.btnSave();
          this.$refs.xTable.remove(row).then(() => {
              let havedata = this.$refs.xTable.tableData;
              if (havedata.length > 0) {
                  if (rowindex >= havedata.length) rowindex = havedata.length - 1;
                  let selectrow = havedata[rowindex];
                  this.$refs.xTable.setCurrentRow(selectrow);
                  this.$refs.xTable.scrollToRow(selectrow);
                  this.queryDetail(selectrow.kindno);
              } else {
                  this.$refs.xTable.setCurrentRow(null);
                  this.seckind = {};
                  this.oldFormData = {};
                  this.tableData = [];
                  this.tableData1 = [];
                  this.selrow = [];
              }
              this.operate = "M";
              this.statusflag = "NHC";
          });
      },
      async btnSave() {
          if (!this.seckind.kindno) {
              this.$message.warning("类别代号不能为空！");
              this.$refs.refkindno.focus();
              return false;
          }
          if (!this.seckind.kindna) {
              this.$message.warning("类别说明不能为空！");
              this.$refs.refkindna.focus();
              return false;
          }
          if (!this.seckind.kindlen) {
              this.$message.warning("类别长度不能为空！");
              this.$refs.refkindlen.focus();
              return false;
          }
          let xTable1date = this.$refs.xTable1.tableData;
          xTable1date.sort((a, b) => {
              return a.seq - b.seq;
          });
          for (let i = 0, len = xTable1date.length; i < len; i++) {
              let tempseq = (i + 1) * 10;
              if (tempseq !== xTable1date[i].seq) {
                  xTable1date[i].seq = tempseq;
              }
          }
          let data = this.$refs.xTable1.getRecordset();
          try {
              const res = await this.$tool.request({
                  url: "MNG/MNG2/MNG220",
                  method: "post",
                  data: {
                      action: "save",
                      oldFormData: this.oldFormData,
                      NewFormData: this.seckind,
                      urec: data,
                      operate: this.operate,
                  },
              });
              if (res.errcode == "1") {
                  this.changeflag = false;
                  this.$message.success("操作成功！");
                  this.statusflag = "NHC";
                  if (this.operate == "M") {
                      this.$nextTick(() => {
                          (this.selrow.kindno = this.seckind.kindno), (this.selrow.kindna = this.seckind.kindna), (this.selrow.kindlen = this.seckind.kindlen), (this.selrow.inputcode = this.seckind.inputcode), (this.selrow.securityflag = this.seckind.securityflag), (this.selrow.description = this.seckind.description), (this.selrow.sysno = this.seckind.sysno), (this.selrow.sortbycode = this.seckind.sortbycode);
                      });
                      setTimeout(() => {
                          this.$refs.xTable.setCurrentRow(this.selrow);
                      }, 10);

                      this.queryDetail(this.seckind.kindno);
                  } else if (this.operate == "A") {
                      this.$refs.xTable.insert(this.seckind).then(({ row }) => {
                          this.$refs.xTable.setCurrentRow(row);
                          this.$refs.xTable.scrollToRow(row);
                          this.operate = "M";
                          this.selrow = row;
                      });
                      this.queryDetail(this.seckind.kindno);
                  } else {
                      this.operate = "M";
                  }
              } else {
                  this.$message.error("操作失败！" + res.errmsg);
              }
          } catch (e) {
              this.$message.warning(e);
          }
      },
      btnCancel() {
          this.$confirm("您确定取消这次改动吗？", "提示", {
              confirmButtonText: "确定",
              cancelButtonText: "取消",
              focusCancelButton: true,
              type: "warning",
          })
              .then(() => {
                  this.operate = "M";
                  this.statusflag = "NHC";
                  let row = this.selrow; //this.$refs.xTable1.getCurrentRow();
                  this.queryDetail(row.kindno);
                  this.changeflag = false;
              })
              .catch(() => {});
      },
      btnPrint(e) {
          if (e.shiftKey) {
              //调整
              var sql = "select top 10 a.kindno as '类别代号',a.kindna as '类别名称',b.codeno as '代号',b.codena as '代号名称' from seckind a left join seccode b on a.kindno=b.kindno";
              sql = btoa(encodeURIComponent(sql));
              jsObj.SetCustomPrintConfig("6008", sql, this.userno, "系统代码维护");
          } else {
              //打印
              var sql = "select a.kindno as '类别代号',a.kindna as '类别名称',b.codeno as '代号',b.codena as '代号名称'  from seckind a left join seccode b on a.kindno=b.kindno";
              sql = btoa(encodeURIComponent(sql));
              jsObj.PrintCustomReport("6008", sql, this.userno, "seckind", "");
          }
      },
      btnExport() {},
      btnImport() {},
      btnAddDetail() {
          var seq = 0;
          var seqk = 0;
          var ishave = false;
          var datarecord = this.$refs.xTable1.tableData;
          if (datarecord.length > 0) {
              try {
                  datarecord.forEach((item) => {
                      if (Number(item.seq) / 10 > seq) {
                          seq = Number(item.seq) / 10;
                      }
                  });
              } catch (e) {}
          }
          seq++;
          seqk = seq * 10;
          this.$refs.xTable1.insert({ kindno: this.seckind.kindno, codeno: "", codena: "", inputcode: "", securityflag: "U", seq: seqk }).then(({ row }) => {
              this.$refs.xTable1.setCurrentRow(row);
              this.$refs.xTable1.setActiveRow(row);
              this.$refs.xTable1.scrollToRow(row);
          });
          this.hasChange();
      },
      btnInsertDetail() {
          let data = this.$refs.xTable1.tableData;
          if (data.length > 0) {
              let row = this.$refs.xTable1.getCurrentRow();
              if (row) {
                  this.$refs.xTable1.insertAt({ kindno: this.seckind.kindno, codeno: "", codena: "", inputcode: "", securityflag: "U", seq: row.seq }, row).then(({ row }) => {
                      this.$refs.xTable1.setCurrentRow(row);
                      this.$refs.xTable1.setActiveRow(row);
                      this.$refs.xTable1.scrollToRow(row);
                  });
              } else {
                  this.btnAddDetail();
              }
          } else {
              this.btnAddDetail();
          }
          this.hasChange();
      },
      btnDelDetail() {
          let row = this.$refs.xTable1.getCurrentRow();
          let exedel = false;
          if (row.securityflag == "S") {
              if (this.utype != "G") {
                  this.$message.warning("您没有权限删除安全性为S的数据！");
                  return false;
              } else {
                  exedel = true;
              }
          } else {
              exedel = true;
          }
          if (!exedel) {
              return false;
          }
          let alld = this.$refs.xTable1.tableData;
          let rowindex = alld.indexOf(row);
          this.$refs.xTable1.remove(row).then(() => {
              let havedata = this.$refs.xTable1.tableData;
              if (havedata.length > 0) {
                  if (rowindex >= havedata.length) rowindex = havedata.length - 1;
                  let selectrow = havedata[rowindex];
                  this.$refs.xTable1.setCurrentRow(selectrow);
                  this.$refs.xTable1.scrollToRow(selectrow);
              } else {
                  this.$refs.xTable1.setCurrentRow(null);
              }
          });
          this.hasChange();
      },
      activeCell({ row, column }) {
          if (this.utype != "G") {
              if (row.securityflag == "S") {
                  return false;
              } else {
                  if (column.property == "securityflag") {
                      return false;
                  } else {
                      return true;
                  }
              }
          } else {
              return true;
          }
      },
      EditClose({ row, column }) {
          let _this = this;
          if (column.property == "codena") {
              row.inputcode = this.$pub.CreateInputcode(row.codena, _this, 16);
          }
      },
      EditActived({ row, column }) {
          if (column.property == "codeno") {
              setTimeout(() => {
                  if (!!this.selrow.kindno) row.kindno = this.selrow.kindno;
              }, 10);
          }
      },
      xTableRowClassName({ row, rowIndex }) {
          let isDirty = this.$refs.xTable.hasRowChange(row);
          if (isDirty) {
              return "row-modify";
          }
          if (this.$refs.xTable.hasRowInsert(row)) {
              return "row-new";
          }
      },
      async hasChange() {
          this.changeflag = true;
          this.statusflag = "HC";
      },
      inputautofocus(element) {
          if (element == "refdescription") return false;
          let arr = ["refkindno", "refkindna", "refsysno", "refinputcode", "refkindlen", "refsecurityflag", "refsortbycode", "refdescription"];
          let index = XEUtils.findIndexOf(arr, (item) => item == element);
          var that = this;
          var focusIndex = index + 1;
          var ele = arr[focusIndex];
          setTimeout(function () {
              if (index == 2 || index == 5 || index == 6) {
                  that.$refs[element].blur();
              }
              that.$refs[ele].focus();
          }, 1);
      },
      kindnoChange() {
          this.$tool
              .request({
                  url: "MNG/MNG2/MNG220",
                  method: "post",
                  data: {
                      action: "validKindno",
                      kindno: this.seckind.kindno,
                  },
              })
              .then((res) => {
                  if (res == "-1") {
                      this.$message.error("类别代号重复，请填写新的项目代码！");
                      this.seckind.kindno = "";
                      this.$refs.refkindno.focus();
                  }
              })
              .catch((e) => {
                  this.$message.error(e);
              });
      },
      hasChangeSecurity(e) {
          //该事件不能改为change
          setTimeout(() => {
              this.hasChange();
          }, 10);
      },
      SortByChange(e) {
          this.loading1 = true;
          this.$tool
              .request({
                  url: "MNG/MNG2/MNG220",
                  method: "post",
                  data: {
                      action: "queryDetail",
                      kindno: this.selrow.kindno,
                      sortby: this.seckind.sortbycode,
                  },
              })
              .then((res) => {
                  this.tableData1 = res.Data1;
                  if (res.Data1.length > 0) {
                      this.$refs.xTable1.setCurrentRow(res.Data1[0]);
                  } else {
                      this.$refs.xTable1.setCurrentRow(null);
                  }
                  setTimeout(() => {
                      let xTable1date = this.$refs.xTable1.tableData;
                      for (let i = 0, len = xTable1date.length; i < len; i++) {
                          let tempseq = (i + 1) * 10;
                          if (tempseq !== xTable1date[i].seq) {
                              xTable1date[i].seq = tempseq;
                          }
                      }
                  }, 20);
                  if (this.seckind.sortbycode == "" || this.seckind.sortbycode == "2") {
                      //没有改变
                      this.changeflag = false;
                      this.statusflag = "NHC";
                  } else {
                      this.hasChange();
                  }

                  this.loading1 = false;
              })
              .catch((e) => {
                  this.loading1 = false;
              });
      },
  },
};
</Script>

<style scoped>
/deep/ tr.vxe-body--row.row-new {
  color: #cc6600;
}
/deep/ tr.vxe-body--row.row-modify {
  color: blue !important;
}
.pagetop {
  width: 100%;
  height: 65px;
  display: -webkit-box;
  -webkit-box-pack: left;
  -webkit-box-align: center;
  border: 1px solid #ccc;
  position: absolute;
  z-index: 99;
}

.pagecenter {
  position: absolute;
  top: 70px;
  width: 100%;
  left: 0;
  bottom: 0px;
  overflow: auto;
}

.middle-center {
  position: absolute;
  height: 100%;
  left: 0px;
  right: 505px;
  overflow: auto;
}

.middle-right {
  position: absolute;
  height: 100%;
  width: 500px;
  right: 0px;
}

.table1style tr td {
  padding: 0px 2px 0px 2px;
}

/deep/ .el-button.is-disabled {
  border: 0px;
  color: grey;
  background-color: #e6e6e6;
  font-weight: normal;
}
</style>